package com.dream.technology.service;

import com.dream.technology.db.entity.RcFlowItem;
import com.dream.technology.db.entity.RcRuleCollection;
import com.dream.technology.db.entity.RcRuleCollectionQuery;
import com.dream.technology.db.entity.vo.VoRuleCollection;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface RcRuleCollectionService {

    int countByExample(RcRuleCollectionQuery example);

    int deleteByExample(RcRuleCollectionQuery example);

    int deleteByPrimaryKey(Long id);

    int insert(RcRuleCollection record);

    /**
     * 保存json串 包含item
     * @param record
     * @return
     */
    String insertStr(VoRuleCollection record);

    int insertSelective(RcRuleCollection record);

    List<RcRuleCollection> selectByExample(RcRuleCollectionQuery example);

    RcRuleCollection selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") RcRuleCollection record, @Param("example") RcRuleCollectionQuery example);

    int updateByExample(@Param("record") RcRuleCollection record, @Param("example") RcRuleCollectionQuery example);

    int updateByPrimaryKeySelective(RcRuleCollection record);

    int updateByPrimaryKey(RcRuleCollection record);

    /**
     * 检查规则集设置
     * @param ruleCollection
     * @return
     */
    public String checkRuleCollection(VoRuleCollection ruleCollection) ;


    /**
     *  复制规则集
     * @param id
     * @param tagName
     * @param tagCode
     * @param enabled 
     * @return
     */
    String copy(Long id, String tagName, String tagCode, Boolean enabled);


    /**
     * 根据json修改规则集
     * @param JsonStr
     * @return
     */
    String updateByJsonStr(VoRuleCollection JsonStr);


    /**
     *  查询组装 指定一组规则集
     * @param items
     * @return
     */
    Map<String , Map<RcFlowItem,Object>> getVoRuleCollAll(List<RcFlowItem> items);

}
